import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { setupStore } from './store'
import { globalRegister } from './gloables'
import i18n from './locales'
// 使用动画组件
import { MotionPlugin } from '@vueuse/motion'

// 导入 el-message 组件样式
import 'element-plus/theme-chalk/el-message.css'
// 导入 el-message-box 组件样式
import 'element-plus/theme-chalk/el-message-box.css'
// 引入el-loading样式
import 'element-plus/theme-chalk/el-loading.css'
import 'element-plus/theme-chalk/el-notification.css'
import './style/index.scss'

import 'animate.css'

import 'v-contextmenu/dist/themes/default.css'

const app = createApp(App)

app.use(globalRegister)
app.use(i18n)
// 初始化store，从localStorage中加载本地数据，解决页面刷新，store数据丢失
setupStore()

// Element Plus按需导入时，全局修改组件大小
app.config.globalProperties.$ELEMENT = {
  size: 'small'
}

app.use(router).use(store).use(MotionPlugin).mount('#app')
